<?php

class AppController extends Controller {

    var $components = array('Acl', 'Auth', 'Session');
    var $helpers = array('Form', 'Javascript', 'Html', 'Ajax', 'Session');

    function beforeFilter() {
//Configure AuthComponent
        $this->Auth->authorize = 'actions';
        $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
        $this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login');
//$this->Auth->loginRedirect = array('controller' => 'posts', 'action' => 'add');
        $this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 'home');
        $this->Auth->actionPath = 'controllers/';

        /* $admin = Configure::read('Routing.admin');
          if (isset($this->params[$admin]) and $this->params[$admin]) {
          //$this->layout = 'admin';
          } else {
          $this->Auth->allow();
          } 
        $routing_prefixes = Configure::read('Routing.prefixes');
        if (in_array("admin", $routing_prefixes)) {
            $admin = 'admin';
        }*/
    }

}
?>